package com.example.springboottest.listener;

import com.example.springboottest.event.FnTestEvent;
import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Service;

@Service
public class FnTestEventListener implements ApplicationListener<FnTestEvent> {

    public FnTestEventListener() {
        System.out.println("应用级别事件FnTestEventListener构造函数执行...");
    }

    @Override
    public void onApplicationEvent(FnTestEvent event) {
//        GantEnv.environment = event.getEnvironment();
        System.out.println("event.toString()=\t" + event.toString());
    }
}
